package com.kailing.bootbatch.dynamicdemo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * <h3>partitionjob</h3>
 * <p>ceshi task</p>
 * 上述任务适用于具有固定任务周期的任务，若要修改任务执行周期，只能走“停服务→修改任务执行周期→重启服务”这条路。
 * @author : hduong
 * @version : 1.0
 * @date : 2020-03-20 16:15
 **/
@Lazy(false)
@Component//注入到spring容器
public class SpringStaticCronTask {
    private static final Logger logger = LoggerFactory.getLogger(SpringStaticCronTask.class);

    @Scheduled(cron="0/5 * * * * ?")
    public void staticCronTask() {
        logger.debug("staticCronTask is running...");
    }
}
